local base = game_mode.netbase
local hunter = class("hunter_mode",base)

hunter.roomMax = 20
hunter.roomMin = 1
hunter.roomLast = 60 *3--
hunter.mapName = "hunter"
hunter.teamCount = 20
hunter.itemGenCD = 30
hunter.itemGenTypes = {1,2,3,4,5,6,7}
hunter.npcGenCD = 5
hunter.npcGenTypes = {1,2,3,4,5,6,7,8}
hunter.npcGenCollCheck = true
hunter.enablePlayerRebirth = true
hunter.playerRebirthCD = 1
hunter.playerBirthCollCheck = true
hunter.playerGenTypes = {1,2,3,4,5,6,7,8}

function hunter:getPlayerBirthPos(player)
    if self.playerGenPos then return self.playerGenPos end
    self.playerGenPos = {
        minX = 1,
        maxX = self.map.w-1,
        minY = 1,
        maxY = self.map.h-1
        }
    return self.playerGenPos
end

function hunter:getNPCGenPos()
    if self.npcGenPos then return self.npcGenPos end
    self.npcGenPos = {
        minX = 1,
        maxX = self.map.w-1,
        minY = 1,
        maxY = self.map.h-1
    }
    return self.npcGenPos
end

function hunter:onKill(killer,victim)
    base.onKill(self,killer,victim)
    if not killer or killer.team == 0 then --by npc
        for cid,player in pairs(self.players) do
            if player.tank == victim then
                player.score = 0
            else
                player.score = player.score + 1
            end
        end
    else -- by player
        killer.player.score = killer.player.score 
            + (victim.player and victim.player.score or 1)
        if victim.player then
            victim.player.score = 0
        end
    end
    self:sendScoreData()
end

return hunter